/*
 * StateAction.h
 *
 *  Created on: Jun 17, 2011
 *      Author: mariano
 */

#ifndef STATEACTION_H_
#define STATEACTION_H_

#include <string>
using std::string;


class StateAction {

	public:

		typedef enum {
			STATIC, LEFT, RIGHT
		} MovementType;

	private:
	

		bool movement;
		MovementType movType;
		int value;
	
	public:
	
		StateAction(MovementType movType) {
			this->movement = true;
			this->movType = movType;
			this->value = 0;
		}
	
		StateAction(int value) {
			this->movement = false;
			this->value = value;
			this->movType = STATIC;
		}
	
		int getValue() {
			return value;
		}
		
		MovementType getMovementType() {
			return movType;
		}
	
		bool isMovement() {
			return movement;
		}
		
		string toString(){
			if(movement){
				switch(movType){
					case LEFT:
						return string(1,'<');
					case RIGHT:
						return string(1,'>');
				}
			}
				return string(1,'0' + value);				
		}
	};

#endif /* STATEACTION_H_ */
